#ifndef ChannelPropertiesWindow_H
#define ChannelPropertiesWindow_H

#include "QtGui/qapplication.h"
#include "QtGui/qtgui"
#include "Agora.h"
#include "IChannel.h"

using namespace AgoraClient;

class ChannelPropertiesWindow: public QWidget
{
	Q_OBJECT

	public:
		ChannelPropertiesWindow(QWidget *parent = NULL);
		void SetChannel(IChannel *channel);
		IChannel *GetChannel();
		void reload();
	signals:
		void				SetChannelSig(IChannel* channel);
		void				reload(int tab);
	public slots:
		void			reloadUserList(int tab);
	private slots:
		void			SetChannelGUI(IChannel* channel);
		void			saveChan();
		void			tempDisplay(QWidget*);
		void			banUser();
		void			unbanUser();
		
		void			saveChanRight();
		void			selectUser(QListWidgetItem *current, QListWidgetItem *previous);
		void			selectNotBannedUser(QListWidgetItem *current, QListWidgetItem *previous);
		void			selectBannedUser(QListWidgetItem *current, QListWidgetItem *previous);
		void			enableChangePass(int);
	private:
		void			initRightsList();
		void			addRights(const char *txt);
		void			setRights(unsigned int row, bool checked);
		IChannel		*_channel;
		QWidget			*_parent;
		QTabWidget		*onglets;
		QWidget			*page1;
		QWidget			*page2;
		QWidget			*page3;
		QLineEdit		*_chanName;
		QLineEdit		*_chanDesc;
		QLineEdit		*_chanMOTD;
		QLineEdit		*_chanPass;
		QLineEdit		*_chanConPass;
		QCheckBox		*_editPass;
		QListWidget		*listUserRight;
		QListWidget		*listUserRightRights;
		QPushButton		*saveRights;
		unsigned int	_userIdforRights;
		unsigned int	_userIdforUserNotBanned;
		unsigned int	_userIdforUserBanned;
		QPushButton* banUserButton;
		QPushButton* unbanUserButton;
		QListWidget		*listUserNotBanned;
		QListWidget		*listUserBanned;
		//bool			_audioInStarted;
		//bool			_audioOutStarted;
};

#endif